package com.huawei_jikao;
import java.util.*;

/**
 * Created by Z-hong on 2024/7/11.
 */

public class HJ4 {
    static final String YUAN="aeiouAEIOU";

    static class Record{
        int count;
    }

    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int count = in.nextInt();
        String str=in.next();
        char[] charArray = str.toCharArray();
        List<Record> list= new ArrayList<>();
        int flag=0;

        for (int i = 0; i < charArray.length; i++) {
            if(YUAN.contains(charArray[i]+"")){
                list.add(new Record());
                flag++;
            }else{
                if(flag>0){
                    list.get(flag-1).count++;
                }
                if(i==charArray.length-1){
                    list.get(flag-1).count=0;
                }
            }
        }
        int i=0;
        int j=1;
        int Max=0;
        int num=list.get(i).count;
        while(j<list.size()){
            if(num==count){
                Max=Math.max(Max,num+j-i+1);
                num+= list.get(j).count;
                j++;
            }
            else if(num< count){
                num+= list.get(j).count;
                j++;
            }else{
                num-=list.get(i).count;
                i++;
            }
        }
        System.out.println(Max);

    }
}
